Copyright: Copyright © 1997 RealSoft Development


BlockHeader Property

Applies to

TrsShareware

Declaration

property BlockHeader: TBlock;

Description

Blockheader contains nested properties about the first "block" of the dialog. This is usually the title of the product or program.


BlockInfo Property

Applies to

TrsShareware

Declaration

property BlockInfo: TBlock;

Description

Blockinfo contains nested properties about the second "block" of the dialog. This is usually a description of the product, and registration terms.


BlockOrder Property

Applies to

TrsShareware

Declaration

property BlockInfo: TBlock;

Description

Blockorder contains nested properties about the third "block" of the dialog. This usually contains pricing and ordering information.


Caption Property

Applies to

TrsShareware

Declaration

property Caption:  String;

Description

Sets the caption of the shareware dialog window.


DisplayStatus Property

Applies to

TrsShareware

Declaration

property DisplayStatus:  Boolean;

Description

Determines whether or not the dialog will display the registration status at the bottom of the form.


Enabled Property

Applies to

TrsShareware

Declaration

property Enabled:  boolean;

Description

Setting enabled to false will stop the dialog from being displayed even if the Execute method is called.


OnBeforeShow

OnAfterShow

OnRegister


Example of making a custom component into shareware

To make a component shareware requires a more advanced understanding of Delphi, and a few extra lines of code.  To use TrsShareWare in your custom component, add rsShware to your component unit USES clause.  Next, add the following lines to your

component's CONSTRUCTOR, or another CAREFULLY chosen spot in your code:

constructor TMyNewComponent.Create(AOwner: TComponent);

var	rsShareWare1 : TrsShareWare;

Begin

inherited Create(AOwner);

try rsShareWare1 := TrsShareWare.Create(Self);

{modify rsShareware properties such as dialog text, orShareType here}

rsShareWare1.ShareType:= stCounterWare;

rsShareWare1.MaxCount:= 15;

rsShareWare1.Execute;

{check shareware status if desired}

(rsShareware1.ShareStatus = ssExpired) then Application.Terminate;  {trial period is over}

finally rsShareWare1.Free; end;

end;

Note:  Be careful where you place this code!  If you place it in the wrong spot, you may interfere with normal Delphi operations and cause problems.  We advise not to place TrsShareWare code in the DESTRUCTOR or LOADED procedures.


Example of making a project into shareware

To use TShareWare in your Delphi project, first drop a TrsShareWare component anywhere on your main form.  You should then customize the component for your program by modifying its properties (see list of properties).  Whenever you need to display

the shareware dialog, add this line of code:  Shareware1.Execute.We suggest adding this line to your form's OnClose or OnCreate events.  The following line of code will check the status of the shareware to see if it has expired:  If Shareware1.ShareStatus = ssExpired then {do something} That's all you'll need to use the basic features of the component.

This example uses a TrsShareware dropped onto a form.  Create a FormCreate event handler by double clicking the form, and add the following code:

procedure TForm1.FormCreate(Sender: TObject);

begin

  rsShareware1.Execute;

  if (rsShareware1.ShareStatus = ssExpired) then Close;  {trial period is over}

  if (rsShareware1.ShareStatus = ssTampered) then begin

    Showmessage('Youre trying to be sneaky!');

    Close;

    end;

end;


Execute Method

Applies to

TrsShareware

Declaration

procedure Execute;

Description

Displays the TShareWare dialog and updates the ShareWare status.


FileDate Property

Applies to

TrsShareware

Declaration

property FileDate: String

Description

Sets the date of the "secret file".  We suggest using a date that will be difficult to pick out from the other files in the WINDOWS directory.  If you do not specify a date, the current date will be used.


FileHide Property

Applies to

TrsShareware

Declaration

property FileHide: Boolean

Description

Setting this property to true will make the "secret file" attribute hidden.


FileName Property

Applies to

TrsShareware

Declaration

property FileName: String

Description

This property contains the name of the "secret file".  We suggest using a name that will fool nosy users, such as WINDAT.DLL or any other disguising name. The windows directory is loaded with filenames like that.

Note: If you do not specify a filename, the "secret file" will be disabled, and TimerWare and CountWare will never change status!


FileSize Property

Applies to

TrsShareware

Declaration

property FileSize: Integer

Description

Sets the size of the "secret file".  For hiding purposes, we allow variable sizes.  You must specify a file size between 32 and 32,000 for the "secret file" to work.


MaxCount Property

Applies to

TrsShareware

Declaration

property MaxCount : Integer;

Description

Sets the maximum number of times that CountWare allows users run a program.


MaxDays Property

Applies to

TrsShareware

Declaration

property MaxDays : Integer

Description

Sets the maximum number of days that TimerWare allows users run a program.


Execute


OnAfterShow Event

Applies to

TrsShareware

Declaration

event OnAfterShow;

Description

Occurs after dialog is closed.


OnBeforeShow Event

Applies to

TrsShareware

Declaration

event OnBeforeShow

Description

Occurs just before dialog is displayed.


OnRegister Event

Applies to

TrsShareware

Declaration

event OnRegister

Description

Occurs after correct password has been entered, and status:= ssRegistered.


Password Property

Applies to

TrsShareware

Declaration

property Password : String

Description

Upon entering a password , a 'register' button will appear on the dialog.  Users can then register the component at any time after "purchasing" a password from you.


BlockHeader	Enabled

BlockInfo	DisplayStatus

BlockOrder	FileName

ShareType	FileDate

ShareStatus	FileSize

MaxCount	FileHide

MaxDays	Password

RemainCount	Caption

RemainDays	SilentMode


Registering

If you are evaluating a trial edition of this product,

you may register on Compuserve, or the internet.

Source code for components is always included.

Product: TrsShareware

Price (US): $25.00

CIS Reg: 11829


RemainCount Property

Applies to

TrsShareware

Declaration

property RemainCount : Integer

Description

Contains current uses left in CounterWare.

Runtime and Read-Only.


RemainDays Property

Applies to

TrsShareware

Declaration

property RemainDays : Integer

Description

Contains current days left in TimerWare.

Runtime and Read-Only.


Secret file

To protect your TimerWare and CounterWare from cheaters who will definitely try to beat the program by re-installing or changing the system date, TShareWare stores it's information in a special file written to the user's WINDOWS directory.  The only way

to restart the TimerWare or CounterWare is to delete this file.  Fortunately, we have provided several ways to disguise this file so users would have to find a needle in a haystack!  You are the only person who will know about the "secret" file.


ShareStatus Property

Applies to

TrsShareware

Declaration

property ShareStatus : TShareStatus;

Description

ShareStatus allows you to check the current status of the shareware program. You can use ShareStatus in your program to trigger other events in your program.

Status

TShareStatus = (ssUnRegistered, ssRegistered, ssExpired, ssTampered)

ssUnRegistered means the software has not been registered, but has not expired.

ssRegistered means the user has entered the correct password to register.

ssExpired means the user has exceeded the limit of TimerWare or CounterWare.

ssTampered means the user has modified the "secret file" or changed the date!


ShareType Property

Applies to

TrsShareware

Declaration

property ShareType: TShareType;

Description

ShareType sets the type of shareware.  Note that TimerWare and CounterWare require other important properties to be set to work properly, such as MaxCount or MaxDays.  stDelphi_IDE is useful for Delphi components or tools you may have written.

Sharetype

TShareType = (stNagWare, stCounterWare, stTimerWare, stDelphi_IDE)

stNagWare: 	No timers, just a dialog

stCounterWare: Limits usage based on how many times a user runs a program

stTimerWare: 	Limits usage based on days passed since first installed.

stDelphi_IDE: 	Only works while delphi 1 or 2 is running.


SilentMode Property

Applies to

TrsShareware

Declaration

property SilentMode : boolean

Description

SilentMode allows you to use the ShareStatus and Timer/Counter features of TrsShareWare without displaying a dialog.  You can use your own dialog based upon ShareStatus if you wish.

Note:  ShareStatus is not updated until a call to EXECUTE is made.  You

should turn SilentMode on, and then call EXECUTE before checking ShareStatus!


TBlock object

Applies to

TrsShareware

Declarations

property TBlock.AlignmentText:	Aligns the text in the block.

property TBlock.BorderStyle:	Selects a border for the block

property TBlock.Color:	Selects the background color for the block

property TBlock.Ctl3D	Selects a 3-D look for the block

property TBlock.Font	Selects the font for the block

property TBlock.Lines	Strings that make up the block text.

property TBlock.ScrollBars	Enables scrollbars for the block text.

Description

A TBlock is a nested object that contains properties about a block of text.  Each section of a TrsShareware is a TBlock, and can have a unique appearance.


 TrsShareware Component

Properties     Methods       Events

Unit

rsShware

Description

TrsShareware is a component designed to allow you to easily convert your Delphi project or custom component into a trial version for distribution.  By dropping a TrsShareware onto your form, you have access to several powerful properties and methods.  The type of shareware can be changed using the ShareType property. If you are using counterware or timerware, you'll also need to set the MaxCount or MaxDays property, respectively.  To change the appearance of the popup dialog, modify the BlockHeader, BlockInfo, and BlockOrder nested properties.  The hidden file properties can be changed using the FileName, FileDate, FileSize, and  FileHide properties.  An optional registration password can be set using the Password property. The status of the rsShareware can be checked using the ShareStatus property.  The component can be disabled using the Enabled propery.

To preview the dialog at design time, just double click the TrsShareware component icon.

Example of making a project into shareware

Example of making a custom component into shareware

Registering the trial version

Copyright 1997 RealSoft Development

Support: www.realsoftdev.com

DISCLAIMER:

USE THIS SOFTWARE AT YOUR OWN RISK.  REALSOFT WILL NOT BE HELD RESPONSIBLE FOR LOSS OF SALES DUE TO IMPROPER USE,  TAMPERING, OR MALFUNCTION OF THIS SOFTWARE.